package com.inifitness.common.tools;

import java.io.InputStream;

import com.alibaba.excel.EasyExcelFactory;
import com.inifitness.common.easyexcel.MyAnalysisEventListener;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * Excel工具
 *
 * @author sunjinfeng
 * @version 1.0.0
 * @since 2024/04/18 11:00:00
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ExcelUtils {

  public static <T> String importExcel(InputStream is, Class clazz,
      MyAnalysisEventListener<T> listener) {
    EasyExcelFactory.read(is, clazz, listener).sheet().doRead();
    return listener.getMsg();
  }
}
